<?php

session_start();
if($_SESSION['is_login'] !== 'yes'){
    header("Location:/login.php");
    exit;
}

define('YANGJIFANG',true);

require_once "db.php";
$db = new Db();

$id = intval($_GET['id']);
if($id < 0){
    $id = 0;
}

$num = $db->delete($id,'posts');
if($num){
    echo "删除陈功";
}else{
    echo '删除失败';
}

?>
